package com.qyhl.cloud.webtv.module_integral.wallet.cash;


import com.qyhl.webtv.commonlib.entity.intergral.AccountBean;
import com.qyhl.webtv.commonlib.entity.intergral.CashLimitBean;
import com.qyhl.webtv.commonlib.entity.intergral.IntegralUserInfoBean;

public class CashPresenter implements CashContract.CashPresenter {
    private CashActivity mView;
    private CashModel mModel;

    CashPresenter(CashActivity mView) {
        this.mView = mView;
        this.mModel = new CashModel(this);
    }

    @Override
    public void getCashLimit() {
        mModel.getCashLimit();
    }

    @Override
    public void doCommit(String username, int money, String platform) {
        mModel.doCommit(username, money, platform);
    }

    @Override
    public void getSuccess(CashLimitBean bean) {
        mView.getSuccess(bean);
    }

    @Override
    public void getError(int code, String msg) {
        switch (code) {
            case 0:
                mView.getNetError(msg);
                break;
            default:
                mView.getError(msg);
                break;
        }
    }

    @Override
    public void docommitSuccess(AccountBean bean) {
        mView.docommitSuccess(bean);
    }

    @Override
    public void docommitError(int code, String msg) {
        switch (code) {
            case 0:
                mView.getNetError(msg);
                break;
            default:
                mView.docommitError(msg);
                break;
        }
    }

    @Override
    public void getInfo(String username) {
        mModel.getInfo(username);
    }

    @Override
    public void getInfoSuccess(IntegralUserInfoBean bean) {
        mView.getInfoSuccess(bean);
    }

    @Override
    public void getInfoError(String msg) {
        mView.getInfoError(msg);
    }
}
